const Koa = require('koa');
const Router = require('koa-router') // koa 路由中间件
const app = new Koa();
const router = new Router(); // 实例化路由
router.get('/hello/list', async (ctx, next) => {
  // var name = ctx.params.name; // 获取请求参数
  ctx.response.body = {
    "status": 2004,
    "data": [{
      "img": "https://dst-app-pubread-dev.oss-cn-shenzhen.dstzc.com/dst2.0/test/goodsCenter/goods/add/Wangeditor311/24.jpg",
      "title": "f那烦死见风使舵房价高分开了",
      "author": "我主",
      "isAdvert": false
    }, {
      "img": "https://dst-app-pubread-dev.oss-cn-shenzhen.dstzc.com/dst2.0/test/goodsCenter/goods/add/Wangeditor425/v2-7be96ccbb62d6ceebec4d521f66cac05_r.jpg",
      "title": "及放假都是官方功夫格斗归属感和富国汇个梵蒂冈郭德纲的风格得给对方刚好大家刚好大家观峰嘉邸和房间跟华府店家刚好",
      "author": "我是一个up主",
      "isAdvert": true
    }, {
      "img": "https://dst-app-pubread-dev.oss-cn-shenzhen.dstzc.com/dst2.0/test/goodsCenter/goods/add/Wangeditor205/v2-7753e16ccece2703cdd9c0a86dc81788_r.png",
      "title": "过分过分的郭德纲梵蒂冈",
      "author": "一个up主",
      "isAdvert": true
    }, {
      "img": "https://dst-app-pubread-dev.oss-cn-shenzhen.dstzc.com/dst2.0/test/goodsCenter/goods/add/Wangeditor425/v2-7be96ccbb62d6ceebec4d521f66cac05_r.jpg",
      "title": "有一个凤凰股份鬼地方个的个鬼地方个的发个梵蒂冈的",
      "author": "主",
      "isAdvert": true
    }]
  }
});

app.use(router.routes());
// app.use(async ctx => {
//   ctx.body = "{\"status\":200,\"data\":[{\"img\":\"https://dst-app-pubread-dev.oss-cn-shenzhen.dstzc.com/dst2.0/test/goodsCenter/goods/add/Wangeditor311/24.jpg\",\"title\":\"f那烦死见风使舵房价高分开了\",\"author\":\"我主\",\"isAdvert\":false},{\"img\":\"https://dst-app-pubread-dev.oss-cn-shenzhen.dstzc.com/dst2.0/test/goodsCenter/goods/add/Wangeditor425/v2-7be96ccbb62d6ceebec4d521f66cac05_r.jpg\",\"title\":\"及放假都是官方功夫格斗归属感和富国汇个梵蒂冈郭德纲的风格得给对方刚好大家刚好大家观峰嘉邸和房间跟华府店家刚好\",\"author\":\"我是一个up主\",\"isAdvert\":true},{\"img\":\"https://dst-app-pubread-dev.oss-cn-shenzhen.dstzc.com/dst2.0/test/goodsCenter/goods/add/Wangeditor205/v2-7753e16ccece2703cdd9c0a86dc81788_r.png\",\"title\":\"过分过分的郭德纲梵蒂冈\",\"author\":\"一个up主\",\"isAdvert\":true},{\"img\":\"https://dst-app-pubread-dev.oss-cn-shenzhen.dstzc.com/dst2.0/test/goodsCenter/goods/add/Wangeditor425/v2-7be96ccbb62d6ceebec4d521f66cac05_r.jpg\",\"title\":\"有一个凤凰股份鬼地方个的个鬼地方个的发个梵蒂冈的\",\"author\":\"主\",\"isAdvert\":true}]}";
// });

app.listen(3000);

